<template>
	<cl-select-table
		v-model="value"
		:title="t('选择商户')"
		:service="service.order.merchant"
		:columns="columns"
		:multiple="multiple"
		:dict="{ text: 'merchantName', value: 'id' }"
		pickerType="text"
	/>
</template>

<script setup lang="ts">
defineOptions({
	name: 'order-merchant-select'
});

import { useCool } from '/@/cool';
import { useI18n } from 'vue-i18n';
import { CrudProps } from '/#/crud';
import { reactive, ref, useModel } from 'vue';

const props = defineProps({
	...CrudProps,
	modelValue: null,
	multiple: Boolean,
	shopObj: Object
});

const { service } = useCool();
const { t } = useI18n();

const value = useModel(props, 'modelValue');

const columns = ref([
	{ label: t('ID'), prop: 'id', minWidth: 140 },
	{ label: t('商户名称'), prop: 'merchantName', minWidth: 140 },
	{ label: t('商务号'), prop: 'merchantBusiness', minWidth: 140 },
	{ label: t('描述'), prop: 'merchantDescription', minWidth: 140 }
]);
</script>
